package cn.tom.mvc;

import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class MyMvcConfig implements WebMvcConfigurer {
    /*注册拦截器*/
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        /*注册拦截器，除了自定义静态资源，所以页面都需要经过此拦截器*/
        registry.addInterceptor(new LoginTnterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/user/go2login","/user/login");
        /*无需拦截的路径*/
    }
}
